#ifndef __SWEI_UPLINK_H
#define __SWEI_UPLINK_H

#include "task/service/include/swei_common.h"

#ifdef __cplusplus
extern "C" {
#endif


enum {
    UPLINK_STATUS_IDLE,
    UPLINK_STATUS_SENDING,
    UPLINK_STATUS_RESENDING
};

typedef struct {
    uint32_t loc_cnt;
    uint32_t loc_ack;
    uint32_t can_cnt;
    uint32_t can_ack;
    uint32_t alarm_cnt;
    uint32_t alarm_ack;
    uint32_t fail_cnt;
    uint8_t  status;
}uplink_record_t;

void swei_uplink_init(void);
void swei_uplink_process(void);
void swei_uplink_deinit(void);
uplink_record_t *swei_uplink_get_rec(void);
void swei_uplink_data_clear(void);
bool swei_online_status_get(void);
bool swei_uplink_data_idle_get(void);
uint32_t swei_uplink_data_next_stime_get(void);
void swei_uplink_ack_proc(uint8_t ack_data_type, uint32_t serial_num);
bool base_report_is_busy(void);
#ifdef __cplusplus
}
#endif

#endif
